package sojo.com.inverter.config;

import com.serotonin.modbus4j.exception.ModbusInitException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.core.annotation.Order;
import sojo.com.inverter.modbus.ModbusRTUClient;

/**
 * @author cheng_hu
 * @description:
 * @date 2023-02-22 14:55:53
 */
@Configuration
@Order(Integer.MIN_VALUE)
public class AppConfiguration {

    @Bean
    @Scope("singleton")
    public ModbusRTUClient modbusTCPHuaweiInverter() throws ModbusInitException {
        return new ModbusRTUClient("127.0.0.1", 8010);
    }

//    @Bean
//    @Scope("singleton")
//    public ModbusRTUClient modbusTCPHuaweiInverter_01() throws ModbusInitException {
//        return new ModbusRTUClient("127.0.0.1", 503, false);
//    }

}
